package com.seven.bus.mapper;

import com.seven.bus.entity.BusInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.seven.bus.entity.BusInfoVO;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author seven
 * @since 2021-01-12
 */
public interface BusInfoMapper extends BaseMapper<BusInfo> {

    @Select("select * from bus_info")
    @Results({
            @Result(column = "id", property = "id"),
            @Result(column = "id", property = "line", javaType = List.class
                    , many = @Many(select = "com.seven.bus.mapper.BusLineMapper.getLineByBusInfoId"))
    })
    List<BusInfoVO> listDe();
}
